Skip to content

Tag command injection fix #24861

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 17, 2025
Merged

Conversation

Toritos01
Copy link
Contributor

@Toritos01 Toritos01 commented Jun 17, 2025

Description

Use checkout action instead of command line for checking out a tag in GitHub Actions.

I validated the bug fix by putting a code injection in release tag and then pushing the tag to main on my fork. The result of this was that the injection was completely omitted from the tag name, and the workflow worked as expected:
image
https://github.com/Toritos01/FluidFramework/actions/runs/15691947672/job/44209020812

Brandon Diaz added 2 commits June 16, 2025 16:21
@Copilot Copilot AI review requested due to automatic review settings June 17, 2025 16:02
@github-actions github-actions bot added area: build Build related issues base: main PRs targeted against main branch labels Jun 17, 2025
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR replaces unsafe git checkout commands with the pinned actions/checkout action and adds secure parameters to mitigate tag command injection.

  • Swaps out raw git checkout for actions/checkout@<sha> with explicit ref.
  • Adds fetch-depth: 0 and persist-credentials: false to ensure full history and no credential leakage.
Comments suppressed due to low confidence (1)

.github/workflows/push-tag-create-release.yml:89

  • [nitpick] The checkout action is duplicated for push and workflow_dispatch jobs; consider consolidating into a single step by parameterizing the ref to reduce duplication and improve maintainability.
        uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # ratchet:actions/checkout@v3

@Toritos01 Toritos01 merged commit 17bb695 into microsoft:main Jun 17, 2025
31 checks passed
@Toritos01 Toritos01 deleted the bdiaz/tagCommandInjectFix branch June 17, 2025 16:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: build Build related issues base: main PRs targeted against main branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants